package com.example.my.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.security.Permission;
import java.time.LocalDateTime;
import java.util.List;


@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("roles")
public class Role {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String name; // 角色名

    private String description; // 描述

    @TableField("role_key")
    private String roleKey; // 角色标识，用于权限校验

    private Integer status; // 状态，0：禁用，1：正常

    @TableLogic(value = "0", delval = "1")
    private Integer deleted; // 逻辑删除字段，0：未删除，1：已删除

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private List<Permission> permissions;

    public Role(long l, String testUser, String 测试用户, String s) {
    }

    public void setPermissions(List<com.example.my.entity.Permission> permissions) {
    }
}